{% extends 'frontend/index_base.html' %}
{% block title %}个人中心{% endblock %}
{% block content %}
<div class="container py-5">
    <div class="row">
        <div class="col-lg-4">
            <div class="card">
                <div class="card-body text-center">
                    <img src="https://via.placeholder.com/150" class="rounded-circle mb-3" alt="头像">
                    <h4>{{ current_user.username }}</h4>
                    <p class="text-muted">学生</p>
                </div>
            </div>
            <div class="card mt-3">
                <div class="card-body">
                    <h5 class="card-title">学习统计</h5>
                    <div class="d-flex justify-content-between mb-3">
                        <span>完成练习</span>
                        <span class="badge bg-primary rounded-pill">0</span>
                    </div>
                    <div class="d-flex justify-content-between mb-3">
                        <span>获得徽章</span>
                        <span class="badge bg-success rounded-pill">0</span>
                    </div>
                    <div class="d-flex justify-content-between">
                        <span>学习天数</span>
                        <span class="badge bg-info rounded-pill">1</span>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-lg-8">
            <div class="card">
                <div class="card-body">
                    <h5 class="card-title">个人信息</h5>
                    <form action="{{ url_for('users.profile') }}" method="post">
                        <div class="mb-3">
                            <label for="username" class="form-label">用户名</label>
                            <input type="text" class="form-control" id="username" value="{{ current_user.username }}" readonly>
                        </div>
                        <div class="mb-3">
                            <label for="email" class="form-label">邮箱</label>
                            <input type="email" class="form-control" id="email" name="email" value="{{ email if email else '' }}" required>
                        </div>
                        <div class="mb-3">
                            <label for="grade" class="form-label">年级</label>
                            <select class="form-select" id="grade" name="grade">
                                <option value="">请选择</option>
                                <option value="1">一年级</option>
                                <option value="2">二年级</option>
                                <option value="3">三年级</option>
                                <option value="4">四年级</option>
                                <option value="5">五年级</option>
                                <option value="6">六年级</option>
                            </select>
                        </div>
                        <button type="submit" class="btn btn-primary">保存修改</button>
                    </form>
                </div>
            </div>
            <div class="card mt-3">
                <div class="card-body">
                    <h5 class="card-title">最近学习</h5>
                    <div class="list-group list-group-flush">
                        <div class="list-group-item">
                            <div class="d-flex w-100 justify-content-between">
                                <h6 class="mb-1">Python基础课程</h6>
                                <small class="text-muted">今天</small>
                            </div>
                            <p class="mb-1">完成了第一章的学习</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}
